var main_window = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIWebNavigation).QueryInterface(Components.interfaces.nsIDocShellTreeItem).rootTreeItem.QueryInterface(Components.interfaces.nsIInterfaceRequestor).getInterface(Components.interfaces.nsIDOMWindow);
if (gBrowser) gBrowser.removeProgressListener(panabeemini_urlBarListener);
},
onDomContentLoaded: function(event){
var doc = event.originalTarget;
if (doc.nodeName == '#document' && doc == content.document && panabeemini.is_results_page(content.document.location)) { // Show sidebar
panabeemini.show_results();
} else if (doc.nodeName == '#document' && doc == content.document && content.document.location.href.indexOf('http://www.panabee.com/s?') != -1) { // On Panabee results page
var iframes = content.document.getElementsByTagName('iframe');
for (var i = 0; i < iframes.length; i++) {
iframes[i].contentDocument.wrappedJSObject.body.addEventListener('click', function(event) { var link = null; if (event.originalTarget.href) { link = event.originalTarget; } else if (event.originalTarget.parentNode && event.originalTarget.parentNode.href) { link = event.originalTarget.parentNode; } if (link) { var d = new Date(); link.setAttribute('target', '_newtab' + d.getTime()); }}, false);
if (content.document.location.hash) { // DOMContentLoaded fires for non-AJAX pages. If hash is present, invoke show_results directly since DOMContentLoaded won't fire.
setTimeout(panabeemini.show_results_after_delay, 1000); // Delay in order to let AJAX calls complete